package com.sh.studydateformat.controller;

import com.sh.studydateformat.bean.StudyDateFromat;
import com.sh.studydateformat.mapper.StudyDateFromatMapper;
import jakarta.annotation.Resource;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: sh
 * @Version 1.0
 * @Description:
 */
@RestController
@RequestMapping("/date")
public class OneController {

    @Resource
    public StudyDateFromatMapper studyDateFromatMapper;
    @GetMapping("/one")
    public StudyDateFromat getOne(@RequestParam("id")String id) {
        StudyDateFromat one = studyDateFromatMapper.getOne(id);
        System.out.println("id = " + one.getId());

        System.out.println("name = " + one.getName());
        System.out.println("createTime = " + one.getCreateTime());
        return one;
    }


    @GetMapping("/two")
    public StudyDateFromat getTwo(@RequestParam("id")String id) {
        StudyDateFromat studyDateFromat = new StudyDateFromat();
        studyDateFromat.setName("shihao");
        return studyDateFromat;
    }
}

